import axios from "axios";
import { ElMessage } from "element-plus";

const server = axios.create({
});

server.interceptors.request.use(
    (config) => {
        // 从本地存储中获取 token
        const token = localStorage.getItem("token");
        if (token) {
            // 将 token 添加到请求头中
            config.headers.token = `${token}`;
        }
        return config;
    },
    (error) => {
        return Promise.reject(error);
    }
);


export default server;
